<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
<div>aaa</div>
<div class="header">bbb</div>
<div id="ab">ccc</div>

<script>
(function (global) {

	function jQuery(selector) {
		//1.获取页面中所有的元素
	    //2.把元素放到一个特定的对象中
	    return new F(selector)
	}

	function F(selector) {
		// 把DOM元素放到这个对象中
	    const elements = document.querySelectorAll(selector);
	    this.elements = elements;
	}
	F.prototype.css = function(name,val){
		for(let i=0;i<this.elements.length;i++){
			let element = this.elements[i]
				element.style[name] = val;
		}
	}

	global.$ = global.jQuery = jQuery;

})(window)
$(".header").css('color','red')
</script>
</body>
</html>